import yaml

with open(file="../configs/config.yaml", mode="r",encoding='utf-8') as f:
    res = yaml.safe_load(f)
print(res)

# 下面的案例是进行写入的案例
# import yaml
#
# data = {
#     "Person": {
#         "name": "John",
#         "age": 30,
#         "address": {
#             "street": "123 Main St",
#             "city": "Anytown",
#             "state": "CA"
#         }
#     }
# }
# # 将data变量存储的数据写入YAML文件
# with open(file="../configs/example.yaml", mode="w") as f:
#     yaml.dump(data, f)